<?php
namespace app\mobile\service;
use think\Db;

class CompanyService
{
    public static function IsLogin()
    {
        return session('company_user.id') ? true : false;
    }
	
	
	/**
     * 更新cookie  
     * @return boolean  setcookie(name, value, expire, path, domain);
     */
    public static function setcookietime()
    {  
    	if(!empty($_COOKIE['PHPSESSID'])){   		
    		$sid = $_COOKIE['PHPSESSID'];
			$expire = time()+config('session.expire');
			setcookie('PHPSESSID', $sid, $expire,'/');
    	}	  	
    }
	
	
	/**
     * 获取企业基本信息
     * @param int $mid
     * @return array
     */
    public static function CompanyInfo($mid)
    {
        return Db::name('system_company')->where(['mid'=>$mid])->find();          
    }
}